from structural.adapter.Adapter import Adapter
from structural.adapter.Car import Car
from structural.adapter.Cat import Cat
from structural.adapter.Dog import Dog
from structural.adapter.Human import Human

if __name__ == '__main__':
    objects = []
    dog = Dog()
    objects.append(Adapter(dog, dict(make_noise=dog.bark)))
    cat = Cat()
    objects.append(Adapter(cat, dict(make_noise=cat.meow)))
    human = Human()
    objects.append(Adapter(human, dict(make_noise=human.speak)))
    car = Car()
    car_noise = lambda: car.make_noise(10)
    objects.append(Adapter(car, dict(make_noise=car_noise)))

    for obj in objects:
        print("A", obj.name, "goes", obj.make_noise())
